<?php

class Default_Model_Seat {
	protected $_seatId;
	protected $_row;
	protected $_status;
	protected $_member;
	protected $_reservationDate;
	
	function __construct() {
	
	}
	
	public function __set($name, $value)
    {
        $method = 'set' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Seat property');
        }
        $this->$method($value);
    }

    public function __get($name)
    {
        $method = 'get' . $name;
        if (!method_exists($this, $method)) {
            throw new Exception('Invalid Seat property');
        }
        return $this->$method();
    }
    
	/**
	 * @param $_reservationDate the $_reservationDate to set
	 */
	public function setReservationDate($_reservationDate) {
		$this->_reservationDate = $_reservationDate;
	}

	/**
	 * @return the $_reservationDate
	 */
	public function getReservationDate() {
		return $this->_reservationDate;
	}

	/**
	 * @param $_member the $_member to set
	 */
	public function setMember($_member) {
		$this->_member = $_member;
	}

	/**
	 * @return the $_member
	 */
	public function getMember() {
		return $this->_member;
	}

	/**
	 * @param $_status the $_status to set
	 */
	public function setStatus($_status) {
		$this->_status = $_status;
	}

	/**
	 * @return the $_status
	 */
	public function getStatus() {
		return $this->_status;
	}

	/**
	 * @param $_row the $_row to set
	 */
	public function setRow($_row) {
		$this->_row = $_row;
	}

	/**
	 * @return the $_row
	 */
	public function getRow() {
		return $this->_row;
	}

	/**
	 * @param $_seatId the $_seatId to set
	 */
	public function setSeatId($_seatId) {
		$this->_seatId = $_seatId;
	}

	/**
	 * @return the $_seatId
	 */
	public function getSeatId() {
		return $this->_seatId;
	}
	
	public function setMapper($mapper)
    {
        $this->_mapper = $mapper;
        return $this;
    }

    public function getMapper()
    {
        if (null === $this->_mapper) {
            $this->setMapper(new Default_Model_SeatMapper());
        }
        return $this->_mapper;
    }

    public function save()
    {
        $this->getMapper()->save($this);
    }

    public function find($id)
    {
        $this->getMapper()->find($id, $this);
        return $this;
    }

    public function fetchAll()
    {
        return $this->getMapper()->fetchAll();
    }
	
}

?>